---
import type { HTMLAttributes } from "astro/types";

type Props = HTMLAttributes<"a">;

const { href, class: className, ...props } = Astro.props;

const { pathname } = Astro.url;
const isActive = href === pathname || href === pathname.replace(/\/$/, "");
---

<a
  href={href}
  data-astro-prefetch
  class={`text-themeAccent underline-offset-3px ${
    isActive ? "font-bold underline" : "font-medium"
  }`}
  {...props}
>
  <slot />
</a>
